home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_100 / 122_01 / io < prev    next >
Text File  |  1984-03-05  |  8KB  |  237 lines

  1. I/O OPERATIONS AND PARAMETERS:
  2. copyright (C) 1983 by E. E. Bergmann
  3. definitions in alphabetical (ASCII) order
  4. :
  5. ::
  6. *********************************************************
  7. *                            *
  8. * PISTOL-Portably Implemented Stack Oriented Language   *
  9. *            Version 2.0            *
  10. * (C) 1983 by    Ernest E. Bergmann            *
  11. *        Physics, Building #16            *
  12. *        Lehigh Univerisity            *
  13. *        Bethlehem, Pa. 18015            *
  14. *                            *
  15. * Permission is hereby granted for all reproduction and *
  16. * distribution of this material provided this notice is *
  17. * included.                        *
  18. *                            *
  19. *********************************************************
  20. :
  21. ::
  22. #LINES        After PISTOL accepts input for compilation, the
  23.         variable is reset to 0. As each line is output
  24.         this variable is incremented and compared with
  25.         the current value of TERMINAL-PAGE; if equal
  26.         input from the user (typically a carriage
  27.         return) is used to cause a pause in the output
  28.         scrolling.  At this point, any input character
  29.         will cause #LINES to be reset to 0.  If the
  30.         input character is a 'Q', the current activity
  31.         is ABORTed.
  32.  
  33. #TYPE    Prints a set of digit values from the top of stack
  34.     until a negative (sentinel) is encountered.  (Used
  35.     to define '= ).
  36.  
  37. <U#>    It is used to convert the value on the top of stack
  38.     into separate digits with -1 as sentinel.  Its output
  39.     on stack can be used by #TYPE (Used in the definition
  40.     of '= ).
  41.  
  42. =    type the numerical value of the top of stack;
  43.     no leading or trailing blanks are supplied.
  44.  
  45. =PACK    converts signed value on top of stack into a string.
  46.     It leaves a pointer to this string on stack.
  47.  
  48.  
  49. ?    types the numerical value of the RAM location
  50.     pointed to by the top of stack; equivalent to
  51.     " W@ = ".
  52.  
  53. ASCII    converts a small number (a digit) into its ASCII
  54.     representation.
  55.  
  56. BINARY    sets the base for numerical I/O to 2.
  57.  
  58. COLUMN        Variable that contains the column number that
  59.         the console is at during output.  It is reset
  60.         to 0 whenever a NEWLINE character is output.
  61.         During output to the console if the value of
  62.         COLUMN becomes equal to the value of
  63.         TERMINAL-WIDTH then a new line is begun.
  64.  
  65. CONSOLE        Boolean variable that will prevent output
  66.         to the user's terminal if it is set to FALSE.
  67.         Probably would be used in connection with
  68.         writing lengthy output to the listfile when
  69.         there is no desire to have this information
  70.         presented to the user's console as well.
  71.  
  72. CR    Outputs a carriage return, line-feed sequence.
  73.  
  74. DECIMAL     sets the base for numerical I/O to 10.
  75.  
  76. ECHO        Boolean variable which, when set TRUE, causes
  77.         whatever PISTOL code that is being LOADed to be
  78.         listed as it is being compiled.
  79.  
  80. HEX    sets the base for numerical I/O to 16.
  81.  
  82. IFCR    does a CR if not in column 0.
  83.  
  84. INDENT    advances to the coulumn specified by the top of
  85.     stack unless one is already there or beyond.
  86.     Trying to indent beyond TERMINAL-WIDTH, causes
  87.     a new line to be started instead.
  88.  
  89. INFILE        Does not contain 0 when LOADing from a file
  90.         or from the edit buffer.  Contains pointer to
  91.         original (temporary) filename string if
  92.         inputing from a file.  If input is from the
  93.         edit buffer, its contents is the current line
  94.         number.  INFILE contains 0 [false] when
  95.         interpreting from the console keyboard.
  96.  
  97. INPUT    takes the line number on the top of stack and allows
  98.     the user to enter (insert above the old line specified)
  99.     as many new lines as desired into the edit buffer.
  100.     Completion of input is signified by supplying an
  101.     empty line (an immediate carriage return).
  102.  
  103. INPUTFILE-STATUS
  104.         Contains the status of the file being input by
  105.         the editor (opened by OPENR).  If its value is
  106.         0, the file has just been opened. If positive,
  107.         it is a count of the number of lines read so
  108.         far.  If -1, no file has been opened or: if
  109.         negative, the number of lines read (magnitude)
  110.         and the file is in an eof condition.
  111.  
  112. LIST        Boolean variable when true causes the system
  113.         to output everything that would go to the
  114.         user's console to the listfile as well.  (see
  115.         LISTFILE in i/o).
  116.  
  117. MERR    Prints the error message string that is pointed to by
  118.     the top of stack; it then ABORTs.
  119.  
  120. MSG    types a message pointed to by the top of stack;
  121.     starts a new line if the string is too long to
  122.     "fit" on current line(tabs not properly estimated).
  123.  
  124. MSGS    takes the number on top of stack as the number of
  125.     that are next to the top of stack that are to be
  126.     output, the BOTTOM-MOST one first.  For example:
  127.  
  128.     'ONE 'TWO 'THREE 3 MSGS
  129.  
  130.     produces:
  131.  
  132.     ONETWOTHREE
  133.  
  134.     If the combined length of all the strings will
  135.     not fit on the current line, a new line is started.
  136.     (tabs not properly estimated).
  137.  
  138. NEWLINE        Typically ord(<CR>) or ord(<LF>); implemented
  139.         char value used to separate line of text from
  140.         next in internal PISTOL representation.  I/O
  141.         routines must convert external (system file
  142.         and console i/o conventions) to NEWLINE in
  143.         PISTOL.
  144.  
  145. OCTAL    sets the base for numerical I/O to 8.
  146.  
  147. OPENR    takes a string pointed to by the top of stack and
  148.     opens that named file for reading.  It is the user's
  149.     responsibility to make sure that the named file
  150.     exists already.  If another file was opened for reading
  151.     previously, it is closed by this new OPENR.
  152.  
  153. OPENW    takes a string pointed to by the top of stack and
  154.     opens that named file for writing.
  155.     (*** It will DESTROY any file that already exists
  156.     with that name!!!****)
  157.  
  158. OUTPUT-STATUS    Indicates status of file for editor's output
  159.         (file opened by OPENW).  If value is +1, no
  160.         file has been opened yet, or it has been
  161.         logically closed.  If the value is 0, the file
  162.         has just been opened, but not yet used.  If
  163.         negative, it's magnitude is the count of the
  164.         number of lines written to the file so far.
  165.  
  166. RADIX        Contains current number base used for i/o
  167.         number conversions.  For example, it is set to
  168.         ten for DECIMAL mode.
  169.  
  170. RAISE        Boolean variable which causes system to convert
  171.         all word tokens and single-quote strings to
  172.         upper case.
  173.  
  174. READ    takes the number of lines specified by the top of
  175.     stack from the file specified by the last OPENR and
  176.     appends them to the end of text in the edit buffer.
  177.  
  178.  
  179. READLINE reads a line of text from the file that has been
  180.         opened for reading (from OPENR) and places it into
  181.         the input line buffer, pointed to by LINEBUF. This
  182.     text will be overwritten by the next input line so
  183.     it should be used prior to the next input line.
  184.  
  185. SPACE    outputs a blank.
  186.  
  187. SPACES    outputs as many blanks as specified by top of stack.
  188.  
  189. TAB    simulates a tab; tab stops are separated by the
  190.     size specified by the variable, TAB-SIZE.
  191.  
  192. TAB-SIZE    Normally set to 8. It determines the space
  193.         between tab stops.
  194.  
  195. TABS    outputs as many simulated tabs as is specified
  196.     by the top of stack.
  197.  
  198. TERMINAL-PAGE    Determines number of lines output between
  199.         scrolling pauses.  See #LINES .
  200.  
  201. TERMINAL-WIDTH    Determines number of characters per line before
  202.         automatic newlines.  See COLUMN .
  203.  
  204. TYI    inputs a character from the keyboard and places
  205.     its ASCII value on the stack.  (Console input is
  206.         buffered line-by-line). If the current line is empty or
  207.     exhausted (except) for the end-of-line, the character
  208.     returned on stack is the NEWLINE character.
  209.  
  210. TYIL    Inputs next character from console (all console input
  211.     is buffered line-by-line), places it on stack; the rest
  212.     of the console line is exhausted so that the next
  213.     character read from the console will be from the start
  214.     of the next line.  If the current line is empty or
  215.     exhausted (except) for the end-of-line, the character
  216.     returned on stack is the NEWLINE character.
  217.  
  218. TYO    outputs a character whose ASCII value is on the    stack.
  219.  
  220. TYPE    types the number of characters of text specified
  221.     by the top of stack from the string area, starting at
  222.     the location pointed to by the next to top of stack.
  223.  
  224. WRITE    takes the number of lines specified by the top of
  225.     stack from the beginning of the text in the edit
  226.     buffer and places them at the end of the file
  227.     specified in the last OPENW.
  228.  
  229. WRITELINE writes that line that is in STRINGS (usually in
  230.     the edit buffer) whose pointer is on the top of the
  231.     stack